<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://<?php echo ($_SERVER['HTTP_HOST']); ?>__TMPL__Public/" />
<title>无标题文档</title>
<link href="css/base.css" rel="stylesheet" type="text/css" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/auntion.css" rel="stylesheet" type="text/css" />
<script src="js/jquery.js" language="JavaScript" type="text/javascript"></script>
<script src="js/auntion.js" language="JavaScript" type="text/javascript"></script>
<script language="javascript">
var userpanel="index";
</script>
</head>
<body>
<div class="wrap">
	<div class="header">
  	<div class="header_content">
      <h1 class="logo"><a href="/" title="海马爸爸">海马爸爸</a></h1>
      <div class="topbar">
      	<?php echo W("UserBar");?> | <a href="/Member/index">我的账户</a> | <a href="#">帮助中心</a> | &nbsp;客服热线：400-800-888<br/>
      	<div class="dingyue">
   		  <form><input type="text" name="email"  value="输入邮箱订阅每日最新信息..." onfocus="if(this.value=='输入邮箱订阅每日最新信息...'){this.value='';}" onblur="if(this.value==''){this.value='输入邮箱订阅每日最新信息...';}"><input type="submit" class="sub_btn"></form>
      	</div>
      </div>
	  <div class="nav">
         <ul>
            <li><a href="/" class="current">首页</a></li>
            <li><a href="#">流程介绍</a></li>
            <li><a href="#">套餐介绍</a></li>
            <li><a href="#">样板衣盒</a></li>
            <li><a href="#">赠与亲友</a></li>
            <li><a href="#">邀请亲友</a></li>
        </ul>
      </div>
    </div>
  </div>
  <div class="main">
    <div class="position"><a href="/">首页</a> &gt; <a href="javascript:;">用户中心</a></div>
    <div class="user">
    	<div class="userpanel">
        	<h2>用户中心</h2>
        	<ul>
            	<li><a href="/Member/index" rel="index">账户管理</a></li>
                <?php $first_id=getFirstBabyId(); ?>
                <?php if(($first_id) != "0"): ?><li><a href="/Member/baby/act/edit/Id/<?php echo ($first_id); ?>" rel="baby">宝宝档案</a></li>
                <?php else: ?>
                <li><a href="/Member/baby" rel="baby">宝宝档案</a></li><?php endif; ?>
                <li><a href="/Member/yueli" rel="yueli">月历本</a></li>
            	<li><a href="/Member/yaoqing" rel="yaoqing">邀请亲友</a></li>
            </ul>
        </div>
<script language="javascript">
$(".userpanel").find("a[rel='"+userpanel+"']").addClass("current");
</script>
      <div class="userbox">
        	<!--<div class="user_tab">
            	<ul>
                	<li class="current"><a href="#">张大宝</a></li>
            		<li><a href="#">李四</a></li>
                </ul>
            </div>-->
            <div class="user_area">
            <div class="account">
            	<p class="loginname"><b>登录帐号：</b><a href="javascript:;" onclick="changepw();">修改密码</a><br/><?php echo ($user["username"]); ?></p>
                <p class="money"><b>账户余额：</b><br/><i><?php echo W("UserReal",array("field" => "balance"));?></i> 元<br/>
                	<button type="submit" class="btn btn-success">充值</button>
                    &nbsp;&nbsp;<button type="submit" class="btn btn-success">返还</button>
                </p>
            </div>
            <div class="address">
            	<h3>收货地址：<a href="javascript:addaddress();">增加地址</a></h3>
                <ul>
                	<li>收件人：阮世能<span><a href="#">设为默认</a> - <a href="#">编辑</a> - <a href="#">删除</a></span><br/>
                    手机号：13455555555&nbsp;&nbsp;&nbsp;&nbsp; 地址：杭州下沙经济开发区6号大街</li>
                    <li>收件人：阮世能<span><a href="#">设为默认</a> - <a href="#">编辑</a> - <a href="#">删除</a></span><br/>
                    手机号：13455555555&nbsp;&nbsp;&nbsp;&nbsp; 地址：杭州下沙经济开发区6号大街</li>
                </ul>
            </div>
            </div>
        </div>
      <div class="clear"></div>
    </div>
  </div>
  
    <div class="footer_content">
  	<div class="biaoyu"></div>
    <a href="#">关于我们</a> | <a href="#">关于我们</a> | <a href="#">关于我们</a> | <a href="#">关于我们</a> | <a href="#">关于我们</a> | <a href="#">关于我们</a><br/>
    &copy;2012 Haimababa.cn  All Rights Reserved<a href="#"> 浙ICP备2012244321号</a>
  </div>
 <div class="footer"></div>
</div>
<script type="text/javascript"> 
function changepw(){
	var d_t = new at_trace();
		d_t.setContact(
			"增加地址",
			"<div class=add_address><p>旧密码:<input type='text' id='oldpassword' /></p><p>新密码:<input type='text' id='newpass' /></p><p>再输一次:<input type='text' id='newpass2' /></p><p id='msg'></p></div>",
			[
				d_t.getButton("确定", "yellow", function(){
					if($("#newpass").val()!=$("#newpass2").val())
					{
						$("#msg").html("两次密码不一致");
						return ;
					}
					
					$.getJSON("/Member/changepw",
					{
						oldpassword: $("#oldpassword").val(),
						newpassword: $("#newpass").val()
					},function(json){
						if(json.status==1)
						{
							//d_t.hide();
							d_t.setDisplay("hide");
							//setTimeout(function(){,500);
							at_infoTrace.show('密码已更新！','o');
						}
						else
						{
							$("#msg").html(json.info);
						}
					});
					
					
				}),
				d_t.getButton("返回", "gray", "close")
			]

		);
		d_t.setWidth(450);
		d_t.setDisplay("show");
}

function addaddress(){
	var d_t = new at_trace();
		d_t.setContact(
			"增加地址",
			"<div class=add_address><p>旧密码:<input type='text' id='oldpassword' /></p><p>新密码:<input type='text' id='newpass' /></p><p>再输一次:<input type='text' id='newpass2' /></p><p id='msg'></p></div>",
			[
				d_t.getButton("确定", "yellow", function(){
					if($("#newpass").val()!=$("#newpass2").val())
					{
						$("#msg").html("两次密码不一致");
						return ;
					}
					
					$.getJSON("/Member/changepw",
					{
						oldpassword: $("#oldpassword").val(),
						newpassword: $("#newpass").val()
					},function(json){
						if(json.status==1)
						{
							//d_t.hide();
							d_t.setDisplay("hide");
							//setTimeout(function(){,500);
							at_infoTrace.show('密码已更新！','o');
						}
						else
						{
							$("#msg").html(json.info);
						}
					});
					
					
				}),
				d_t.getButton("返回", "gray", "close")
			]

		);
		d_t.setWidth(450);
		d_t.setDisplay("show");
}
</script> 
</body>
</html>